public class 方法或函数重载 {
    public static void main(String[] args) {
        System.out.printf("%d+%d=%d\n",1,2,add(1,2));
        System.out.printf("%.1f+%.1f=%.1f",1.3,2.7,add(1.3,2.7));
        //%.nf即为保留n位小数
    }

    static int add(int a, int b){//整型
        return a+b;
    }
    static double add(double a,double b){//浮点型
        return a+b;
    }
}
